/**
 * Created by chuaiqing on 16/1/12.
 */
'use strict';

angular.module('mk.controllers').controller('TaskManagerCtrl', ['$scope', '$modal', '$log', '$location', 'TaskService', function ($scope, $modal, $log, $location, TaskService) {
    //
    var tasks = [];
    for (var i = 0; i < 100; i++) {
        var item = {};
        item.id = i + 1;
        item.sno = i + 1;
        item.taskname = "任务" + item.sno;
        item.taskclassfullname = "mk.task.impl.SettlementTaskJob";
        item.taskgroupname = "结算任务";
        item.taskstate = "启用";
        item.taskcronexpr = "0 0 0 * ?";
        item.tasktime1 = "2016-01-12 00:00:00";
        item.tasktime2 = "2016-12-31 23:59:59";
        tasks.push(item);
    }
    $scope.tasks = tasks;

    $scope.test = function(task) {
        console.log(task);
        TaskService.test();
    };

    $scope.startTask = function(task) {
        task.taskstate = "启用";
    };

    $scope.stopTask = function(task) {
        task.taskstate = "停用";
    }
}]);